﻿
using Model.ModelDto;
using Service.DI;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Configuration;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using Utils.Mvvm;

namespace ViewModel
{
    public class MainWindowViewModel : BindableBase,ISingletonService
    {
        private string _strTitle;
        public string StrTitle
        {
            get => _strTitle;
            set
            {
                _strTitle = value;
                OnPropertyChanged(nameof(StrTitle));
            }
        }

        public ObservableCollection<MenuModelOutputDto> MenuItems { get; set; }
        private MenuModelOutputDto _selectedMenuItem;
        private readonly Action<string, object> _triggerMainWindowFunction;

        public MainWindowViewModel()
        {
            _triggerMainWindowFunction = TriggerTheMainWindow;


        }

        private void TriggerTheMainWindow(string funName, object parts)
        {
            MessageBox.Show("触发主窗口");
        }

        public MenuModelOutputDto SelectedMenuItem
        {
            get => _selectedMenuItem;
            set
            {
                _selectedMenuItem = value;
                OnPropertyChanged(nameof(SelectedMenuItem));
                // 可选：在这里添加导航逻辑或命令
            }
        }



    }
}
